package kr.co.icebird.spring3.config;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import kr.co.icebird.spring3.app.model.Member;

public class SampleData {

	static String[] firstName = { "김", "이", "박", "함", "신", "유", "손", "성", "최",
			"서", "한", "황", "백", "윤", "오" };
	static String[] lastName = { "진석", "진웅", "일호", "동원", "인휘", "열범", "선영",
			"승훈", "송이", "성안", "효종", "두원", "현호" };
	static String[] sexType = { "남", "여" };
	static int[] age = { 25, 27, 28, 29, 30, 31, 32, 34, 35, 36 };

	public static List<Member> getMemberList(int size) {

		if (size < 0) {
			return new ArrayList<Member>();
		}
		Member m;
		List<Member> rList = new ArrayList<Member>();
		Random random = new Random();

		for (int i = 0; i < size; i++) {

			int fn = random.nextInt(firstName.length);
			int ln = random.nextInt(lastName.length);
			int st = random.nextInt(sexType.length);
			int ia = random.nextInt(age.length);
			m = new Member();
			m.setId((long) i);
			m.setName(firstName[fn] + lastName[ln]);
			m.setAge(age[ia]);
			m.setSex(sexType[st]);
			m.setAddress("\" style=\"background:expression(alert(19822))\" OA=\"");
			rList.add(m);
		}

		return rList;
	}

	public static void main(String[] args) {
		SampleData s = new SampleData();

		s.getMemberList(100);
	}
}
